package com.db4o.nb;

import com.db4o.nb.api.Db4oServer;
import com.db4o.nb.api.impl.Db4oServerImpl;
import com.db4o.nb.db4ofiletype.Db4oDataLoader;
import java.util.Iterator;
import org.openide.loaders.DataLoader;
import org.openide.modules.ModuleInstall;
import org.openide.util.Utilities;

/**
 * Manages a module's lifecycle. Remember that an installer is optional and
 * often not needed at all.
 */
public class Installer extends ModuleInstall {
  
  public void restored() {
    // By default, do nothing.
    // Put your startup code here.
  }
  
  public boolean closing() {

    Iterator it = Db4oServerImpl.serverInstances.iterator();
    while (it.hasNext()) {
      Db4oServer s = (Db4oServer)it.next();
      s.stop(true);
    }
    return true;
  }
}
